Block management for mass storage

ABSTRACT

An embodiment of the present invention includes a nonvolatile memory system comprising nonvolatile memory for storing sector information, the nonvolatile memory being organized into blocks with each block including a plurality of sectors, each sector identified by a logical block address and for storing sector information. A controller is coupled to the nonvolatile memory for writing sector information to the latter and for updating the sector information, wherein upon updating sector information, the controller writes to the next free or available sector(s) of a block such that upon multiple re-writes or updating of sector information, a plurality of blocks are substantially filled with sector information and upon such time, the controller rearranges the updated sector information in sequential order based on their respective logical block addresses thereby increasing system performance and improving manufacturing costs of the controller.

RELATED APPLICATIONS

This application is a continuation of U.S. patent application Ser. No.11/652,727, filed on Jan. 11, 2007 (allowed), titled “Block ManagementFor Mass Storage” which is a continuation of U.S. patent applicationSer. No. 10/455,550, filed on Jun. 4, 2003, now U.S. Pat. No. 7,167,944issued on Jan. 23, 2007, titled “Block Management For Mass Storage”,which is a continuation-in part of U.S. patent application Ser. No.09/620,544, filed on Jul. 21, 2000, now U.S. Pat. No. 6,978,342 issuedon Dec. 20, 2005 titled “Moving Sectors Within a Block of Information Ina Flash Memory Mass Storage Architecture”, the disclosures of which areincorporated herein by reference as though set forth in full.

BACKGROUND OF THE INVENTION

1. Technical Field

The present invention relates generally to methods and apparatus forimproving the performance of file management within nonvolatile memorydevices and particularly to increasing the speed of writing or storinginformation to such nonvolatile memory devices.

2. Description of Prior Art

Various prior art methods and techniques were used to manage files, i.e.store data and read back data, within nonvolatile memory devices.Generally, a host device commands a controller, coupled between the hostdevice and nonvolatile memory, to store certain information withinnonvolatile memory and later to read the same. Such information dependson the application of the nonvolatile memory device. For example, in thecase of digital cameras, digital pictures or photos is the informationstored and retrieve from nonvolatile memory. In the case of PersonalComputers (PCs), information is stored and retrieved from hard disk.

Since information is typically organized in sectors, each sectorincluding a predetermined number of user data and a predetermined numberof overhead data, the host commands the controller to store sectorinformation by referencing addresses associated with particular sectors.For example, there may be sectors 0 through N and each a group ofsectors may define a block which would also have an address associatedtherewith for identifying the same. The controller uses sector addressesto organize digital information within the nonvolatile memory device.

In one prior art technique, as a part of file management of nonvolatilememory, when the host device commands the controller to write or storeinformation to one or more particular sectors, identified by logicalblock addresses (LBAs), the controller writes to physical blockaddresses (PBAs) in the nonvolatile memory. Each block includes a verylarge amount of nonvolatile memory space, for example, 64 Kbytes. When aparticular sector is updated or rewritten thereto in nonvolatile memory,the controller writes the updated sector information to another locationwithin the 64 Kbyte block space. To keep track of the current sectorinformation, flags and address information are utilized and are updatedby the controller to reflect the status of the sector. U.S. Pat. No.5,341,330, issued on Aug. 23, 1994 to Wells et al. and entitled “MethodFor Writing to a Flash Memory Array During Erase Suspend Intervals” isan example of the teachings of such prior art technique. In the casewhere a particular sector is updated within a block, the sector locationincluding previous information is marked ‘old’ utilizing a flag and thenew or current sector location is marked ‘new’. Finally, when the blockis full, i.e. no free or available location remains, a new block is usedto store further updates to sectors and the old block is eventuallyerased prior to being re-utilized.

An example of the above discussion is perhaps better shown by referenceto the example of FIG. 1 depicting a block 10 and a block 12, each ofwhich include 64 Kbytes of storage area organized into sector locationsfor storing sector information. The number of sector locations includedwithin a block is a function of the size of each sector. In the case,for example, where each sector includes 512 bytes, the number of sectorsincluded within a block having 64 Kbytes is obviously 64×1024 divided by512 or 128.

Referring still to FIG. 1, when the host writes to a sector locationidentified by LBA 0, the controller stores said information into 14 andassociated flag(s) are set to ‘new’ the first time such a write or storeoperation takes place after erasure of the block 10. However, afterfollowing writes to the same sector, eventually, sector 0 at 14 will beset to ‘old’ indicating that the information stored therein is no longercurrent and that the controller should read another location to obtainthe latest sector 0 information. This occurs when sector 0 is re-writtenor updated a following time and because information at 14 cannot bere-written without the block 10 first being erased. Since no erasure ofblock 10 has taken place, the next time sector 0 is written, itsinformation will be placed at 28 and while the flag for location 14 willbe set to ‘old’, the flag for location 28 is set to ‘new’ indicative ofthe most up-to-date sector 0 information until the latter is againupdated, at which time the current information is stored for location 44in block 10 and the flag at 44 is set to ‘new’ while the flag forlocation 28 is set to ‘old’.

The scenario described above applies to the writing or updating of allother sectors. By brief way of example, sector information identified byLBA 1, is initially written at 16 and the next time it is written, it iswritten to the next available location in Block 10 which is location 30and the following time after that when it is written by the host, it iswritten at 36 and the flags of 16, 30 and 36 are updated as describeabove. This process continues until the block 10 becomes full at whichtime a new, or available, or free block is found by the controller, inthis case, block 12. From thereon, updated sector information is writtento the block 12, not only this, but at some point, if necessary, allsector locations including current sector information are moved to theblock 12, as explained in U.S. Pat. No. 5,341,330.

For example, in FIG. 1, after the first time when the sector identifiedby LBA 50 is written, assuming the host commands the controller to writeto LBA 50 a next time and the block 10 is found to be full, there-writing of sector 50 takes place within the block 12 rather than theblock 10. In fact, the re-written sector 50 information is written at 50and all other sectors designated as having current or ‘new’ sectorinformation are moved to the block 12. This includes the sectoridentified by LBA 901, which is at 24 in block 10 and moved to 52 inblock 12, the sector identified by LBA 902, which is at 26 in block 10and moved to 54 in block 12, the sector identified by LBA 900, which isat 34 in block 10 and moved to 56 in block 12 (note that this sector wasinitially written at 22 but the sector information at 22 is now ‘old’and the most recent information resides at 34, which is the reason formoving the information stored at 34 rather than the information at 22),the sector identified by LBA 1, which is at 36 in block 10 and moved to58 in block 12 and so on.

The above prior art technique is described in further detail in U.S.patent application having Ser. No. 09/620,544 filed on Jul. 21, 2000 andentitled “Moving Sectors Within a Block of Information In a Flash MemoryMass Storage Architure”, the disclosure of which is incorporated hereinby reference as though set forth in full. The problem with thistechnique is that to move all of the sectors including currentinformation to another new block is time consuming and therefore aperformance hindrance. This problem is even further exaggerated whenusing smaller block sizes as there are more numerous move operationswith smaller block sizes and smaller block sizes are more prevalent bytoday's users of nonvolatile memory devices, particularly by users ofnonvolatile memory devices.

In the patent document referred to hereinabove, a method and apparatusis introduced for improving the performance of managing files or datawithin nonvolatile memory by organizing the memory into smaller blocksizes and introducing a virtual logical block address (VLBA) to PBArelationship and a unique VLBA was assigned to each block and withineach VLBA were sectors arranged in sequential order for decreasing thenumber of moves to expedite or improve the performance of the systemthrough the use of mapping of PBAs to VLBAs. This VLBA to PBA mappingcaused the size of the space manager within the controller device todecrease thereby resulting in a less expensive manufacturing of thecontroller device. However, in this method, it is presumed that sectorsare written in sequential order by the host, if this is not the case,there is much wasted memory space.

In further explanation of prior art techniques, FIG. 1( a) shows anothermethod for updating sector information in that when sector informationis re-written by a host, the new or updated information need be writtento a free block. For example, as shown in FIG. 1( a), when sectorinformation, identified by LBA 0 in Block 0, is re-written or updated,the updated LBA 0 sector information is written to LBA 0 of Block 1. Allother sectors within the Block 0 need then be moved to Block 1.Accordingly, every time there is a re-write or update of a sector, anentire block of information is moved to a new or free block. Obviously,this adversely affects system performance because every time there is are-write of a sector, a new location within a free block is writtenthereto while the old information remains in the previous block untilthe system erases the latter.

In yet another prior art technique, sectors are not moved necessarilyright away after every sector information update, rather, re-writes andmove operations are kept track thereof and when a block is full ornearly full of mostly old sector information, its current sectorinformation is then moved to a new block. For example, as shown in FIG.1( b), when sector information to LBA 0 is updated, it is written to anavailable sector location in an available or free block but theremaining sectors of the previous block are not moved to the new block.Thus the previous block continues to hold some current sectorinformation as well as some old sector information. The system keepstrack of rewrites so that it has knowledge of which sectors are old andwhich are current and when a block is full or nearly full of old sectorinformation, it moves the current sector information, if any, to the newof available block.

Thus, the need arises for a system and method for file or datamanagement of information that is organized into sectors withinnonvolatile memory devices while improving the performance for doing thesame in an inexpensive manner.

BRIEF DESCRIPTION OF DRAWINGS

FIG. 1 shows an example of a prior art technique for moving sectorinformation upon rewrite or updating operations.

FIG. 1( a) shows another example of a prior art technique for movingsector information upon re-write or updating operations.

FIG. 1( b) shows yet another example of a prior art technique for movingsector information upon re-write or updating operations.

FIG. 2 shows an example of the organization of information withinnonvolatile memory devices is shown, in accordance with an embodiment ofthe present invention.

FIG. 3 illustrates the notion of finding free blocks by the controllerand using the same for re-arranging sector information in accordancewith a method of the present invention.

FIG. 4 further expands on the example of FIG. 2.

DETAILED DESCRIPTION

Referring now to FIG. 2, an example of the organization of informationwithin nonvolatile memory devices is shown, in accordance with anembodiment of the present invention, to include M number of blocks 100,M being an integer with each block including sector information. As willbe apparent shortly, the blocks 100 are temporary locations for storageof sector information commanded to be written by the host through acontroller device. The blocks 100 are shown to include Block N, BlockN+M and Block N+M-1, wherein N is also an integer number. The reason forthe notation N is to emphasize that Block N and in fact Blocks N+M andN+M-1 can be any one of the blocks within a nonvolatile memory. In oneembodiment of the present invention, four blocks are designated as theblocks within 100 and thus temporary locations for storing data orinformation received from the host but in other embodiments of thepresent invention, any number of blocks may be employed.

In one embodiment of the present invention, each block includes 8sectors but again, any number of sectors may be assigned to a blockwithout departing from the scope and spirit of the present invention.Thus, in FIG. 2, Block N includes eight sector locations, as does BlockN+M and Block N+M-1. In the example of FIG. 2, when the host initiallywrites a sector identified by the LBA 0, this information is placed inthe first sector location of Block N, at 102. Next, if the host writesinformation to a sector identified by LBA 1, this information is placedat the next available location within Block N at 104 and assuming thehost next writes to a sector identified by the LBA 10, the same isstored at 106, followed by a host write to a sector identified by LBA11, which is written at 108, LBA 50, which is written at 110, LBA 496,written at 112 and LBA 497 at 114 and 498 at 116. These are all shown tohave been written to Block N.

In this example, the next time the host rewrites to or updates thesector identified by LBA 0, this information is stored in Block N+M, atits first sector location, 116 and at such time, the information at 102in Block N is designated as being ‘old’ through the use of a flag orother means while the sector information at 117 is designated as ‘new’.The same events occur when the scenario repeats itself for the updatingof sector 1 where the location at 104 in Block N is designated as being‘old’ and the location at 118 in Block N+M is designated as ‘new’through the use of their respective flags.

The following sectors to be written, namely the sectors identified byLBAs 2, 3, 50, 496, 497 and 498, are also stored in Block N+M at120-130, respectively. As shown, the sector identified by LBA 50 waspreviously written by the host and stored at 110 in Block N so that whenit is updated, the new sector information is stored at 124 in Block N+Mand the flag at 110 is modified to indicate ‘old’ whereas the flag at124 is modified to indicate ‘new’.

In the example of FIG. 2, the following sector writes are of sectors ofsequential LBA order. This sector information are stored in block N+M-1at 132-146, respectively. That is, the sector identified by LBA 400 isstored at 132, the next sector, identified by LBA 402 is stored at 134and so on until the eight sequential sectors are stored within the BlockN+M-1.

At a time when all of the blocks 100 are filled with sector informationor at the right time, the controller performs a ‘clean-up’ operation,arranging the sectors in sequential order within blocks other than thoseincluded with the blocks 100 thus enabling the space manager within thecontroller device to avoid maintaining track of information storedwithin nonvolatile memory on a sector-by-sector basis thereby improvingmanufacturing costs associated with the controller device by the latterhaving a smaller space manager requirement. Additionally, as will beevident, the number of move operations of sectors is reduced therebyincreasing system performance.

Referring now to FIG. 3, free blocks are found by the controller andused for re-arranging sector information. In this example, as notedabove, four blocks are employed while other number of blocks may be usedwithout departing from the spirit and scope of the present invention.

In FIG. 3, blocks 200 are shown to include four blocks, namely Block 4,Block 5, Block 6 and Block 7. Again, these blocks need not be Blocks 4-7and can be any free blocks found by the controller. Each VLBA identifiesa unique block having eight sectors. For example, VLBA0 identifies Block4, VLBA 1 identified Block 6, VLBA 62 identifies Block 5 and VLBA 6identified Block 7. It is important to note that the numbering of theVLBAs is a function of the sequential order of the LBAs associated withsectors. That is, sectors identified by LBA 0-7 will be located in VLBA0and the next eight sectors, LBA 8-15 will be in VLBA 1 and the nexteight (not shown in FIG. 3) will be in VLBA 2 and sectors identified byLBAs 496, 497, 498 through 503 are at VLBA 62 because 496 divided by 8is 62, and sectors identified by LBAs 48 through 55 are at VLBA 6 and soon.

During ‘clean-up’, the sectors of FIG. 2 having current sectorinformation (not ‘old’ information) are re-arranged into sequentialorder and placed within the blocks 3 of FIG. 3. Starting with sector 0,the sector identified by LBA 0, is moved from 117 (in FIG. 2) to 202 inFIG. 3. That is, the current sector 0 information, which now resides inBlock N+M rather than Block N, is moved to the first location of Block4, at 202. The sector that is in the next sequential order, i.e. sector1, is found in the blocks 100 of FIG. 2, at 118 and moved to 204 in FIG.3 (whenever reference is made throughout this document to moving asector, the information within the sector or sector information is whatis physically moved). Sector 2 is found at 120 in Block N+M in FIG. 2and moved to 206 in FIG. 3 and sector 3 is found at 122 in FIG. 2 andmoved to 208 in FIG. 3. The next sequentially-ordered sector, sector 4is found in Block 0 (shown in FIG. 1( b)) and moved to 210 in FIG. 3 andthe following 3 sectors follow at 212, 214 and 216 in FIG. 3.

The following eight sectors are sequentially placed within the blockidentified by VLBA 1 in FIG. 3. Each of these sectors is also found fromvarious temporary block locations within blocks 100 in FIG. 2 and movedto the locations 218-232, respectively. That is, sectors 8 and 9 arefound in Block 2 (shown in FIG. 1 (b)) and moved to 218 and 220,respectively. Sectors 10-11 are found at 104 and 106, respectively inBlock N of FIG. 2 and remaining sectors 12-15 are found in Block 2(shown in FIG. 1 (b)) and placed at 226-232, respectively.

In FIG. 3, VLBA 62 is shown to include information for sectors 496-503with sectors 496-498 being moved from Block N+M at 124-130 of FIG. 2,respectively, to 250-254 of VLBA 62 of FIG. 3, respectively and sectors499-503 being moved from Block 1, not shown in FIG. 2, to 256-264 inFIG. 3, respectively. Without going through the details, in a similarfashion, VLBA 6 of FIG. 3 is updated to include sectors 48-55 fromtemporary blocks 100.

Referring back to FIG. 2, Block N+M-1 includes sectors that are alreadyin sequential order, as noted above, since the host wrote them insequential order. Accordingly, there is no need to move these sectorsinto another block for the purpose of reorganizing them into sequentialorder. Rather, Block N+M-1 is renumbered as VLBA Block 50 (this is dueto sectors 400 as divided into 8 being 50) and taken out of temporaryblocks 100 and considered among the blocks 200 of FIG. 3. Thus as shownin FIG. 4, no moves are required for sectors 400-408 saving a number ofoperations that substantially increases the system performance. In fact,the more the number of sequential writes of at least a number of sectorsequal to the number of sectors within a block, the greater the systemperformance due to a lesser number of move operations.

Although the present invention has been described in terms of specificembodiments it is anticipated that alterations and modifications thereofwill no doubt become apparent to those skilled in the art. It istherefore intended that the following claims be interpreted as coveringall such alterations and modification as fall within the true spirit andscope of the invention.

1. A method comprising: writing or storing information associated with aparticular logical block address (LBA) in a sector location of a firstgroup of blocks of memory, the first group of blocks of memorycomprising at least one block of memory and the information comprisingsector information; and rewriting or updating the information associatedwith the particular LBA in a free or available sector location of thefirst group of blocks of memory, wherein rewriting or updating theinformation associated with the particular LBA comprises: writing orstoring rewritten or updated sector information in the free or availablesector location of the first group of blocks of memory; identifying therewritten or updated sector information as being current or new;identifying the sector information associated with the particular LBAthat had been previously written or stored as old; and writing orstoring sector information written or stored in the first group ofblocks of memory and identified as current or new, including therewritten or updated sector information, in sector locations of a secondgroup of blocks of memory in accordance with a sequential order ofrespective LBAs associated with the sector information written or storedin the first group of blocks of memory and identified as current or new,wherein the second group of blocks comprise at least one block ofmemory.
 2. The method of claim 1, wherein each block of the second groupof blocks of memory is associated with a respective virtual logicalblock address (VLBA).
 3. The method of claim 2, wherein a particularVLBA of a particular block of the second group of blocks of memory is afunction of the particular LBAs associated with the sector informationwritten or stored in the particular block.
 4. A method, comprising:writing or storing information associated with a particular logicalblock address (LBA), wherein writing or storing information compriseswriting or storing' sector information in a sector location of a firstblock; rewriting or updating the information associated with the LBA,wherein rewriting or updating the information associated with theparticular LBA comprises writing or storing rewritten or updated sectorinformation in a sector location of a second block; and writing orstoring the rewritten or updated sector information in a sector locationof a third block, wherein the sector location of the third blockcorresponds to a location of the particular LBA in a sequence of LBAsthat are associated with information written or stored in the thirdblock.
 5. The method of claim 4, wherein the third block is associatedwith a particular virtual logical block address (VLBA), and wherein theparticular VLBA of the third block is a function of the LBAs that areassociated with the information written or stored in the third block. 6.The method of claim 4, wherein the sector location of the first block isassociated with a respective physical block address (PBA).
 7. Acontroller configured to: write or store information associated with aparticular logical block address (LBA) in a sector location of a firstblock of memory communicatively coupled to the controller; rewrite orupdate the information associated with the particular LBA in a sectorlocation of a second block of the memory, wherein the controller beingconfigured to rewrite or update the information associated with theparticular LBA comprises the controller being configured to write orstore rewritten or updated sector information in the sector location ofthe second block of the memory; and write or store the rewritten orupdated sector information in a sector location of a third block of thememory, wherein the sector location of the third block corresponds to alocation of the particular LBA in a sequence of LBAs that are associatedwith information written or stored in the third block.
 8. A memorysystem comprising: memory organized into blocks, wherein each blockcomprises a plurality of sector locations, wherein each of the sectorlocations is configured to store sector information; and a controllerconfigured to: write or store information associated with a particularlogical block address (LBA) in a sector location of a first block of thememory; rewrite or update the information associated with the particularLBA in a sector location of a second block of the memory, wherein thecontroller being configured to rewrite or update the informationassociated with the particular LBA comprises the controller beingconfigured to write or store rewritten or updated sector information inthe sector location of the second block of the memory; and write orstore the rewritten or updated sector information in a sector locationof a third block of the memory, wherein the sector location of the thirdblock corresponds to a location of the particular LBA in a sequence ofLBAs that are associated with information written or stored in the thirdblock.
 9. A controller configured to: write or store informationidentified by a particular logical block address (LBA) in a sectorlocation of a first group of blocks of memory communicatively coupled tothe controller, the first group of blocks of memory comprising at leastone block of memory and the information comprising sector information;and rewrite or update the information associated with the particular LBAin a free or available sector location of the first group of blocks ofmemory, wherein the controller being configured to rewrite or update theinformation associated with the particular LBA comprises the controllerbeing configured to: write or store rewritten or updated sectorinformation in the free or available sector location of the first groupof blocks of memory; identify the rewritten or updated sectorinformation as being current or new; identify the sector informationassociated with the particular LBA that had been previously written orstored as old; and write or store sector information written or storedin the first group of blocks of memory and identified as current or newin sector locations of a second group of blocks of memory in accordancewith a sequential order of respective LBAs associated with the sectorinformation written or stored in the first group of blocks of memory andidentified as current or new, wherein the second group of blocks ofmemory comprise at least one block of memory.
 10. The controller ofclaim 9, wherein the controller being configured to identify therewritten or updated sector information as being current or newcomprises the controller being configured to designate the rewritten orupdated sector information as being current or new.
 11. The controllerof claim 9, wherein the controller is configured to write or storesector information written or stored in the first group of blocks ofmemory and identified as current or new in sector locations of a secondgroup of blocks responsive to the first group of blocks beingsubstantially filled with sector information.
 12. The controller ofclaim 9, wherein the controller is configured to write or store sectorinformation written or stored in the first group of blocks of memory andidentified as current or new in sector locations of a second group ofblocks when the first group of blocks are filled with sectorinformation.
 13. The controller of claim 9, wherein the second group ofblocks of memory comprises blocks other than blocks included in thefirst group of blocks of memory.
 14. The controller of claim 9, whereinthe controller is further configured to: associate a particular block ofthe first group of blocks of memory with a particular virtual logicalblock address (VLBA) if all of the sector information written or storedin the particular block is identified as current or new and is writtenor stored in accordance with a sequential ordering of the LBAsassociated with the sector information written or stored in theparticular block; and not write or store the sector information writtenor stored in the particular block of memory of the first group of blocksand identified as current or new in sector locations of the second groupof blocks.
 15. The controller of claim 9, wherein the second group ofblocks comprise a group of free blocks found by the controller.
 16. Thecontroller of claim 9, wherein each of the second group of blocks isassociated with a respective virtual logical block address (VLBA). 17.The controller of claim 16, wherein the particular VLBA of a particularblock of the second group of blocks is a function of the particular LBAsassociated with the sector information written or stored in theparticular block.
 18. The controller of claim 16, wherein the controlleris configured to associate the respective VLBAs with the respectiveblocks of the second group of blocks.
 19. A memory system comprising:memory organized into blocks, wherein each block comprises a pluralityof sector locations, wherein each of the sector locations is configuredto store sector information; and a controller configured to: write orstore information identified by a particular logical block address (LBA)in a sector location of a first group of blocks of the memory, the firstgroup of blocks of memory comprising at least one block of memory andthe information comprising sector information; rewrite or update theinformation associated with the particular LBA in a free or availablesector location of the first group of blocks of memory, wherein thecontroller being configured to rewrite or update the informationassociated with the particular LBA comprises the controller beingconfigured to: write or store rewritten or updated sector information inthe free or available sector location of the first group of blocks ofmemory; identify the rewritten or updated sector information as beingcurrent or new; identify the sector information associated with theparticular LBA that had been previously written or stored as old; andwrite or store sector information written or stored in the first groupof blocks of memory and identified as current or new in sector locationsof a second group of blocks of the memory in accordance with asequential order of respective LBAs associated with the sectorinformation written or stored in the first group of blocks of memory andidentified as current or new, wherein the second group of blocks ofmemory comprise at least one block of memory.
 20. The memory system ofclaim 19, wherein the controller is configured to associate a respectivevirtual logical block address (VLBA) with each blocks of the secondgroup of blocks.